Return to doc.sitecore.com

Valid for Sitecore 5.3
  System.Data.SqlClient.SqlException: Failed to update database “...mdf” because the database is read-only.
Prev Next

This message may indicate a defect in SQL Server. If the specified file is not read-only and appropriate permissions have been applied, this message may appear when trying to log in to Sitecore and typically indicates that the home directory of an IIS web site has been changed; SQL Express may be confused about the location and/or status of the supporting database files. Using a command prompt, restart IIS and SQL Server:

net stop w3svc

net stop "sql server (sqlexpress)"

net start "sql server (sqlexpress)"

net start w3svc

It may also be necessary to remove the Readonly checkbox on the directory containing the database files, to remove obsolete databases in Management Studio and/or to run the equivalent of the following:

ALTER DATABASE <DB> SET READWRITE

Rebooting also seems to be helpful.

See:


Prev Next